﻿using mozhi.smarterp.Finance.Enums;
using System;
using System.Collections.Generic;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;

namespace mozhi.smarterp.Finance.AccountsReceivables
{
    /// <summary>
    /// 应收核销
    /// </summary>
    public class ReceivableSettlement : AuditedAggregateRoot<Guid>, IMultiTenant
    {
        public Guid? TenantId { get; private set; }

        public Guid ReceivableId { get; private set; }

        public DocumentType DocumentType { get; private set; }

        public Guid DucumentId { get; private set; }

        /// <summary>
        /// 核销币别
        /// </summary>
        public Guid SettlementCurrencyId { get; private set; }

        /// <summary>
        /// 核销原币金额
        /// </summary>
        public decimal SettlementAmountFr { get; private set; }

        /// <summary>
        /// 核销本位币金额
        /// </summary>
        public decimal SettlementAmount { get; private set; }

        /// <summary>
        /// 是否自动核销
        /// </summary>
        public bool IsAutoSettlement { get; private set; }

        public List<ReceivableSettlementItem> Items { get; private set; }
    }

    public class ReceivableSettlementItem : Entity<Guid>, IMultiTenant
    {
        public Guid? TenantId { get; private set; }

        public Guid ReceivableItemId { get; private set; }


        public Guid DucumentItemId { get; private set; }

        /// <summary>
        /// 核销原币金额
        /// </summary>
        public decimal SettlementAmountFr { get; private set; }

        /// <summary>
        /// 核销本位币金额
        /// </summary>
        public decimal SettlementAmount { get; private set; }
    }
}
